class MwCatalogRol < ActiveRecord::Base
  attr_accessible :rol_name

  def self.ROLADMINISTRADOR
    return "Administrador"
  end

  def self.ROLMODERADOR
    return "Moderador"
  end

  def self.ROLCONTRIBUYENTE
    return "Contribuyente"
  end

  def rol_name=(rolName)
    if rolName.length>25 && !(rolName == self.ROLADMINISTRADOR||rolName == self.ROLMODERADOR||rolName == self.ROLCONTRIBUYENTE)
      return nil
    end
    write_attribute(:rol_name, rolName)
  end
end
